UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oad1xxpVvg79ZnuqE57nTn9ZfarMJaQ0DvnKwtknqlA=' 
WHERE 
  key_id = '70e0629f3c6a0dcf60181aa108f29b1e51c230b275469505c2cb9b704f793922' 
  AND (
    token = 'oad1xxpVvg79ZnuqE57nTn9ZfarMJaQ0DvnKwtknqlA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022