UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Md+z505x3Nb1lONNHLJk5KAlmsYeBtlJ1ngc6PNNaoE=' 
WHERE 
  key_id = '45543f95b212c6c2bd3fca0dfa2b6e3ce32c51133079c1433e06eb900c1becba' 
  AND (
    token = 'Md+z505x3Nb1lONNHLJk5KAlmsYeBtlJ1ngc6PNNaoE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038