UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'I7kSOLlm6nwsgJFLCpNRF0T419g6WMb0MakqSe6rOx8=' 
WHERE 
  key_id = 'f6f6982b4ada7bcb37ea3105656e0157e00ccbcef42dc31b26990effbeff241b' 
  AND (
    token = 'I7kSOLlm6nwsgJFLCpNRF0T419g6WMb0MakqSe6rOx8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042