UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7B8CqlhVsP9CS+tFi3Fq6hjUpAHLtmaVge4Mb4nFQHM=' 
WHERE 
  key_id = '97921f365d9b6e65b8a428eaa7a06f665fb01b54ef218f880752b540470f386d' 
  AND (
    token = '7B8CqlhVsP9CS+tFi3Fq6hjUpAHLtmaVge4Mb4nFQHM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048