UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8Ous8/dKf0OE6RD6kCvVLjYk2T6jUMxWPMg4iPkOmgM=' 
WHERE 
  key_id = '4d9d45933ef65871dd987c4f0af4b0fb59844e417c485b4fbda8afa9a4619b89' 
  AND (
    token = '8Ous8/dKf0OE6RD6kCvVLjYk2T6jUMxWPMg4iPkOmgM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051