UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gpDm/zSPORQXUTzgejk2jlUXzSu9MotiE6HzKRpN9Ro=' 
WHERE 
  key_id = '8c752d166ee03e2d3d8f7553288835631ab02ede6b20790012c5a69c5981ab01' 
  AND (
    token = 'gpDm/zSPORQXUTzgejk2jlUXzSu9MotiE6HzKRpN9Ro=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00013