UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CZ4njYJIJ0eTzMwmvSUi4H29HYdfsZFYIYSnd7akSWY=' 
WHERE 
  key_id = '0b65f9d9bdc21643fb0be6e4c4bee8eb378f53acae71d999f55aa6728e8e4795' 
  AND (
    token = 'CZ4njYJIJ0eTzMwmvSUi4H29HYdfsZFYIYSnd7akSWY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036