UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2HzV2eEn5hdfbPI8Z3F84elDP3Oowp/2RgC8BP8E+/I=' 
WHERE 
  key_id = '7aa072a9d91fd5f8ffdce105339ae08b396ce0cd3316c87f2a105699e8c40912' 
  AND (
    token = '2HzV2eEn5hdfbPI8Z3F84elDP3Oowp/2RgC8BP8E+/I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044