UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sZ/ZRmqH0Adf7Y2LAW29UzvUX2rfqH/VubJVkVFKpxY=' 
WHERE 
  key_id = 'a10a981f1a4e0c5703cd0b98f679d25a4862ba2a16d47331ff9b0cdac856ddc3' 
  AND (
    token = 'sZ/ZRmqH0Adf7Y2LAW29UzvUX2rfqH/VubJVkVFKpxY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00061