UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Qlsrx0TWJ8A7pJrzBAJD6dPXA693AnoM9W832/d94HU=' 
WHERE 
  key_id = '56761a5fff0230b0c4aacfb63c1f033abcc4daee98376df333e57e8d17af23b2' 
  AND (
    token = 'Qlsrx0TWJ8A7pJrzBAJD6dPXA693AnoM9W832/d94HU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036