UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '71k8A7N0Z4JajLk6Re9+wpfcoBc6EEgcs6jPypZ4Amw=' 
WHERE 
  key_id = 'edb3720d85c16e8d4cfd442eb78cdce5cbb9d998e207025a959e9228c2ab3784' 
  AND (
    token = '71k8A7N0Z4JajLk6Re9+wpfcoBc6EEgcs6jPypZ4Amw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036