UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'utG4wb2YQqOVb3VMC7Ayrxc9QVFob7vLiwjMG/b2fxs=' 
WHERE 
  key_id = '325b53934a70b0884a0e4958ae64f40bfc2c9abb9c765b12194c21b1139328e0' 
  AND (
    token = 'utG4wb2YQqOVb3VMC7Ayrxc9QVFob7vLiwjMG/b2fxs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042