UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qnTvmgf2kOP+cVmB3gT14wU7Vyjv+O4NSZ1kh/Vcetw=' 
WHERE 
  key_id = 'e8c74afb8a6aa5547eae680f2ac84ef0468304eea90b75a5bdd6ce3b729cfbc5' 
  AND (
    token = 'qnTvmgf2kOP+cVmB3gT14wU7Vyjv+O4NSZ1kh/Vcetw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022