UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6v8rs6vOQ7JXyC/fEmFbbhyhqcGIrPYJ3waiB1yV+og=' 
WHERE 
  key_id = '91bbe8e230dd2defb3a2685b9498aa2b5c99f5d64e43f5f11d9e8cb6e8760b94' 
  AND (
    token = '6v8rs6vOQ7JXyC/fEmFbbhyhqcGIrPYJ3waiB1yV+og=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00101