UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'r3ziVo3EU2qZmRV4J/I3/15vNWzi7DFiLyqngZLQ/gY=' 
WHERE 
  key_id = '6982dd482eec80fe90015037d923404140aa505f46187145fd5870ec7c966eac' 
  AND (
    token = 'r3ziVo3EU2qZmRV4J/I3/15vNWzi7DFiLyqngZLQ/gY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017