UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Os+FkNr4lBBYW2bTXwaBil/5AJAJ6h8qIO7fvl8UOzI=' 
WHERE 
  key_id = 'a923925c92b57ffcd5caa63acc6c0a8e959e5da6aba224c76200c8c9a7377ed5' 
  AND (
    token = 'Os+FkNr4lBBYW2bTXwaBil/5AJAJ6h8qIO7fvl8UOzI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039