UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mfrUr6a3OUyUMPFy/cxt9uBNr8o1iciQvqOlH8hf2ac=' 
WHERE 
  key_id = '67aafa33956fc44c3f18418a21e7954333797e35bd123e29c897b0011547d696' 
  AND (
    token = 'mfrUr6a3OUyUMPFy/cxt9uBNr8o1iciQvqOlH8hf2ac=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040