UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zhEoTk1HGrgGFr6XnOYwK0W9WxP8luuvzvJQQju9ypY=' 
WHERE 
  key_id = '55f43ac637110f4fe04c2d57541ed324fe0043354911e2d6a3a58707febd5f76' 
  AND (
    token = 'zhEoTk1HGrgGFr6XnOYwK0W9WxP8luuvzvJQQju9ypY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026