UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wJL5PLK2AsPMOnE1W365rqCfM4Ebsk+V0yRM88YkXAs=' 
WHERE 
  key_id = '2a7ee66d6364704cdb3a00debfda586a28e2b6e622c98a63bebfbe5eb6348dd5' 
  AND (
    token = 'wJL5PLK2AsPMOnE1W365rqCfM4Ebsk+V0yRM88YkXAs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031