UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vSEUXReLf90iMx0hEbA6tj1HxTaHZUd8gLli+XghiUA=' 
WHERE 
  key_id = 'bb3970e08dfae0491abda93e14dabcc01c8038fee2f688f8d8a882c375a66b98' 
  AND (
    token = 'vSEUXReLf90iMx0hEbA6tj1HxTaHZUd8gLli+XghiUA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024