UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iFwwvXkwm2mRHsARrmCLaWynXnsaeh4P9jdzy2bpJG4=' 
WHERE 
  key_id = 'dcb81eaca53db4da2d987524b46dc501212311e94ab5cb28e7072f9aca195151' 
  AND (
    token = 'iFwwvXkwm2mRHsARrmCLaWynXnsaeh4P9jdzy2bpJG4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042