UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bLD4vUXWZoEKtedxziCNKGDDp9b71GrNAaogbrgtk4c=' 
WHERE 
  key_id = 'c3cb393c912fa286bb3f351671b66345bea5f3e2a32e3af4581761c8ab7f5050' 
  AND (
    token = 'bLD4vUXWZoEKtedxziCNKGDDp9b71GrNAaogbrgtk4c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024