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

Query time 0.00038