UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'E9lFIRRAyXlsfgiE/Hiliuvf2S3LmgMM0vu4tsPG/8s=' 
WHERE 
  key_id = '2fe7ead8a5d2cbb0657253c14feef110cc94db8a1d939bfe16a3c42f497c5ec0' 
  AND (
    token = 'E9lFIRRAyXlsfgiE/Hiliuvf2S3LmgMM0vu4tsPG/8s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028