UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gVsQjK48gQ8PUqLXmjQB/lnkSxI2keK314BnanfyNeM=' 
WHERE 
  key_id = '04cb01bf00df2abb3c743e236ed053b12c4cb74c41224e9c8d85eb3ffff71c2a' 
  AND (
    token = 'gVsQjK48gQ8PUqLXmjQB/lnkSxI2keK314BnanfyNeM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017