UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'I2KzkU1fmZZU08tT+we/9H+jwuaqm7cv5OPcd1jAlUY=' 
WHERE 
  key_id = 'c68e3878ea4b4669dcd7f58009409208de96f4535b2ff110ab09e934e622a890' 
  AND (
    token = 'I2KzkU1fmZZU08tT+we/9H+jwuaqm7cv5OPcd1jAlUY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037