UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '68crht3WkN/SPGXhcPfnk8h8tGLppt6qMH92M9fOHdo=' 
WHERE 
  key_id = '68845963b79d4821b856557ac4ce1f51e558f5dc118cbb787c73b77beee58b7e' 
  AND (
    token = '68crht3WkN/SPGXhcPfnk8h8tGLppt6qMH92M9fOHdo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030