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

Query time 0.00020