UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0k42VElDj+2AIkO929P+uU7Qfqy3Sdxl+LML1STOoc8=' 
WHERE 
  key_id = '6b1903b24eb54eedd665c384ff3153762d5a7b1dff393b98812495b2c9e76518' 
  AND (
    token = '0k42VElDj+2AIkO929P+uU7Qfqy3Sdxl+LML1STOoc8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037