UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kLflNoEWnOhm34H2dmHlrdYOr3NzkBGdMMfRI5qe6jA=' 
WHERE 
  key_id = '7512d625dabe551dd0f7da72eb6deb1c7c364ba6f5eca1377bd05a939f596bc9' 
  AND (
    token = 'kLflNoEWnOhm34H2dmHlrdYOr3NzkBGdMMfRI5qe6jA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022