UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2NJh1JnDF8823GxBnvevA5IcP6H6JBWREgknS/Zilig=' 
WHERE 
  key_id = 'ae60184dbddf6603c636eb0e2118668e8d8e85aa43ec380a8a152624df6be393' 
  AND (
    token = '2NJh1JnDF8823GxBnvevA5IcP6H6JBWREgknS/Zilig=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032