UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3bEJ4paoegjCXKtTME9JaW/VJaOktEy8YdO1Pe9KKHI=' 
WHERE 
  key_id = '3e4f8b0da5e5e911e93ed340ca5c19c4b88f2a4d2bc9040d1a4147aa2bde7a2b' 
  AND (
    token = '3bEJ4paoegjCXKtTME9JaW/VJaOktEy8YdO1Pe9KKHI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039