UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+cTJ+BzKFEqrR7J7w+M4mlUYwMtA4nODllEoLCd7sZM=' 
WHERE 
  key_id = '7a5c8ce2b88a61ae027f7d286a92ed4061a30d6235d036c54f8f608b906f44bd' 
  AND (
    token = '+cTJ+BzKFEqrR7J7w+M4mlUYwMtA4nODllEoLCd7sZM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038