UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rzYBGGhLe6iPqv4Chu79IJU+1sVsxwi28/tZsqQbyNQ=' 
WHERE 
  key_id = 'd93c20408ccee4bab9158ccc31b00d17f53aaf54a083c9f154314ac96e50adcd' 
  AND (
    token = 'rzYBGGhLe6iPqv4Chu79IJU+1sVsxwi28/tZsqQbyNQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021