UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'y8ovxV845uOk4IuH+rzNTkqddKUZGJWpiM4zwtdeE0I=' 
WHERE 
  key_id = '41bc582934a31f134f7a6ae003319ec5e15406a7ff2f6978c90da1e3c0e24211' 
  AND (
    token = 'y8ovxV845uOk4IuH+rzNTkqddKUZGJWpiM4zwtdeE0I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029