UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5ODbD0LrCuwGH9y6Oq/moI4+IaTwjGpbjzlcKWDQRLc=' 
WHERE 
  key_id = '8c0fc6ed7271ab08e173dd9f53573a82d206408545761d884e0d6f645fca7af5' 
  AND (
    token = '5ODbD0LrCuwGH9y6Oq/moI4+IaTwjGpbjzlcKWDQRLc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030