UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+koH2jdyPpoQDoEfHMwqHtSFFfs0ddvsUo5pigZ3fgA=' 
WHERE 
  key_id = '236592346d53c04a64cfbf6cc50d97d1ff7c88ad8c493fdfc3da7e656623860c' 
  AND (
    token = '+koH2jdyPpoQDoEfHMwqHtSFFfs0ddvsUo5pigZ3fgA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027