UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'S+sGriFQdswBBtSxc3UbgAcvnLRYZkqjiauYIqkG0KE=' 
WHERE 
  key_id = '5154b036f7f8bb6c7d14767c8553b61bc01b5954b1b2f8824638879e0ecbbef9' 
  AND (
    token = 'S+sGriFQdswBBtSxc3UbgAcvnLRYZkqjiauYIqkG0KE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036