UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kQqHOYfSDQfpxjO3E1/Q90VmgG4YfYCtVcsFJ637rn4=' 
WHERE 
  key_id = 'c3340ee3f33cccf08d5e66a0ea6c332cbd3bac2706a2517bb726db5f673e0d15' 
  AND (
    token = 'kQqHOYfSDQfpxjO3E1/Q90VmgG4YfYCtVcsFJ637rn4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028